package com.sren.boot.service;

import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Service;

/**
 * @author: renshuai
 * @date: 2019/11/25 上午9:18
 * @Description: java7 实现
 */
@Service
@Profile("java7")
public class Java7CalculateService implements CalculateService {
	@Override
	public Integer sum(Integer... values) {
		System.out.println("java7 for 循环实现");
		int sum = 0;
		for (Integer value : values) {
			sum += value;
		}
		return sum;
	}

	public static void main(String[] args) {
		CalculateService calculateService = new Java7CalculateService();
		Integer sum = calculateService.sum(1, 2, 3);
		System.out.println(sum);
	}
}
